from method import Method, Param, KeywordParam, String, Boolean, Integer

class GetTree(Method):
    """
    This method returns a complete tree, starting with Categories and descending
    into SubCategories (if any) and Albums (if any) for the specified user
    (identified by SessionID or (optional) NickName).

    Arguments:
    String NickName (optional)
    Boolean Heavy (optional)
    String SitePassword (optional)
    String ShareGroup (optional)
    
    >>> smugmug.users.getTree()
    [{u'id': ..., u'Name': u'...'}...]
    """

    name = 'smugmug.users.getTree'
    keywordParams = (    
        KeywordParam('NickName', String),
        KeywordParam('Heavy', Boolean),
        KeywordParam('SitePassword', String),
        KeywordParam('ShareGroup', String)
    )
    responseKey = 'Categories'

getTree = GetTree()

class GetTransferStats(Method):
    """
    Gets transfer statitistics for the logged-in user during the given Month and
    Year. SmugMug often only keeps the last few months (current + 2
    previous), but you never know. :)

    Arguments:
    Integer Month
    Integer Year
    
    >>> smugmug.users.getTransferStats(10, 2007)
    {...}
    """

    name = 'smugmug.users.getTransferStats'
    params = (
        Param('Month', Integer),
        Param('Year', Integer)
    )
    responseKey = 'Albums'

getTransferStats = GetTransferStats()

class GetDisplayName(Method):
    """
    Arguments:
    String NickName
    
    >>> smugmug.users.getDisplayName('test')
    {u'DisplayName': u'...'}
    """

    name = 'smugmug.users.getDisplayName'
    params = (
        Param('NickName', String),
    )
    responseKey = 'User'

getDisplayName = GetDisplayName()
